3.1.11 \(\int \frac {\sqrt {1+2 x+x^2}}{\sqrt {1+x^2}} \, dx\) [11]

Optimal. Leaf size=48 \[ \frac {\sqrt {1+x^2} \sqrt {1+2 x+x^2}}{1+x}+\frac {\sqrt {1+2 x+x^2} \sinh ^{-1}(x)}{1+x} \]

[Out]

arcsinh(x)*((1+x)^2)^(1/2)/(1+x)+(x^2+1)^(1/2)*((1+x)^2)^(1/2)/(1+x)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {984, 655, 221} \begin {gather*} \frac {\sqrt {x^2+1} \sqrt {x^2+2 x+1}}{x+1}+\frac {\sqrt {x^2+2 x+1} \sinh ^{-1}(x)}{x+1} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[1 + 2*x + x^2]/Sqrt[1 + x^2],x]

[Out]

(Sqrt[1 + x^2]*Sqrt[1 + 2*x + x^2])/(1 + x) + (Sqrt[1 + 2*x + x^2]*ArcSinh[x])/(1 + x)

Rule 221

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt[a])]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 655

Int[((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[e*((a + c*x^2)^(p + 1)/(2*c*(p + 1))),
x] + Dist[d, Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, p}, x] && NeQ[p, -1]

Rule 984

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)*((d_) + (f_.)*(x_)^2)^(q_.), x_Symbol] :> Dist[(a + b*x + c*x^2)^F
racPart[p]/((4*c)^IntPart[p]*(b + 2*c*x)^(2*FracPart[p])), Int[(b + 2*c*x)^(2*p)*(d + f*x^2)^q, x], x] /; Free
Q[{a, b, c, d, f, p, q}, x] && EqQ[b^2 - 4*a*c, 0] &&  !IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\sqrt {1+2 x+x^2}}{\sqrt {1+x^2}} \, dx &=\frac {\sqrt {1+2 x+x^2} \int \frac {2+2 x}{\sqrt {1+x^2}} \, dx}{2+2 x}\\ &=\frac {\sqrt {1+x^2} \sqrt {1+2 x+x^2}}{1+x}+\frac {\left (2 \sqrt {1+2 x+x^2}\right ) \int \frac {1}{\sqrt {1+x^2}} \, dx}{2+2 x}\\ &=\frac {\sqrt {1+x^2} \sqrt {1+2 x+x^2}}{1+x}+\frac {\sqrt {1+2 x+x^2} \sinh ^{-1}(x)}{1+x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 37, normalized size = 0.77 \begin {gather*} \frac {\sqrt {(1+x)^2} \left (\sqrt {1+x^2}+\tanh ^{-1}\left (\frac {x}{\sqrt {1+x^2}}\right )\right )}{1+x} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[1 + 2*x + x^2]/Sqrt[1 + x^2],x]

[Out]

(Sqrt[(1 + x)^2]*(Sqrt[1 + x^2] + ArcTanh[x/Sqrt[1 + x^2]]))/(1 + x)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.09, size = 16, normalized size = 0.33

method result size
default \(\mathrm {csgn}\left (1+x \right ) \left (\arcsinh \left (x \right )+\sqrt {x^{2}+1}\right )\) \(16\)
risch \(\frac {\arcsinh \left (x \right ) \sqrt {\left (1+x \right )^{2}}}{1+x}+\frac {\sqrt {x^{2}+1}\, \sqrt {\left (1+x \right )^{2}}}{1+x}\) \(37\)
meijerg \(\frac {\arcsinh \left (x \right ) \sqrt {\left (1+x \right )^{2}}}{1+x}+\frac {\sqrt {\left (1+x \right )^{2}}\, \left (-2 \sqrt {\pi }+2 \sqrt {\pi }\, \sqrt {x^{2}+1}\right )}{2 \left (1+x \right ) \sqrt {\pi }}\) \(52\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((1+x)^2)^(1/2)/(x^2+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

csgn(1+x)*(arcsinh(x)+(x^2+1)^(1/2))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1+x)^2)^(1/2)/(x^2+1)^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt((x + 1)^2)/sqrt(x^2 + 1), x)

________________________________________________________________________________________

Fricas [A]
time = 1.19, size = 22, normalized size = 0.46 \begin {gather*} \sqrt {x^{2} + 1} - \log \left (-x + \sqrt {x^{2} + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1+x)^2)^(1/2)/(x^2+1)^(1/2),x, algorithm="fricas")

[Out]

sqrt(x^2 + 1) - log(-x + sqrt(x^2 + 1))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {\left (x + 1\right )^{2}}}{\sqrt {x^{2} + 1}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1+x)**2)**(1/2)/(x**2+1)**(1/2),x)

[Out]

Integral(sqrt((x + 1)**2)/sqrt(x**2 + 1), x)

________________________________________________________________________________________

Giac [A]
time = 2.26, size = 49, normalized size = 1.02 \begin {gather*} -{\left (\sqrt {2} - \log \left (\sqrt {2} + 1\right )\right )} \mathrm {sgn}\left (x + 1\right ) - \log \left (-x + \sqrt {x^{2} + 1}\right ) \mathrm {sgn}\left (x + 1\right ) + \sqrt {x^{2} + 1} \mathrm {sgn}\left (x + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((1+x)^2)^(1/2)/(x^2+1)^(1/2),x, algorithm="giac")

[Out]

-(sqrt(2) - log(sqrt(2) + 1))*sgn(x + 1) - log(-x + sqrt(x^2 + 1))*sgn(x + 1) + sqrt(x^2 + 1)*sgn(x + 1)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {\sqrt {{\left (x+1\right )}^2}}{\sqrt {x^2+1}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((x + 1)^2)^(1/2)/(x^2 + 1)^(1/2),x)

[Out]

int(((x + 1)^2)^(1/2)/(x^2 + 1)^(1/2), x)

________________________________________________________________________________________